﻿@model orienta.Models.PersonasView
@{
    ViewBag.Title = "Edit";
}
<center>
    <div style="width: 840px;">
        <table width="100%" cellpadding="0" border="0" cellspacing="0">
            <tr>
                <td>
                    <table class="tablaPrincipal_MIDIS" width="100%" cellpadding="3" border="0" cellspacing="0">
                        <tr>
                            <td>
                                <table cellpadding="0" cellspacing="0" border="0" width="100%">
                                    <tr>
                                        <td>
                                            <table class="tablaTitulo_MIDIS" style="width: 180PX;" cellpadding="2" cellspacing="0"
                                                border="0">
                                                <tr>
                                                    <td align="center">
                                                        <div id="general" class="divTitulo_MIDIS" style="width: 180PX;">
                                                            <span style="background-color: #b50055; color: white;">[REGISTRAR NUEVA PERSONA]</span>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                        @using (Html.BeginForm(ViewData["Accion"].ToString(), "Persona", FormMethod.Post, new { id = "frmMantenedor" }))
                                        {
                                            @Html.HiddenFor(model => model.nIdePersona)
                                            <table width="100%" class="tablaInterna_MIDIS" cellpadding="0">
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center">
                                                        <table width="99%" border="1" cellpadding="3" cellspacing="0" class="tablaPrincipalSin">
                                                            <tbody class="tituloTextNormal">
                                                                <tr align="left">
                                                                    <td>
                                                                        Primer Nombre
                                                                    </td>
                                                                    <td style="width: 2px;">
                                                                        :
                                                                    </td>
                                                                    <td>
                                                                        @*<input type="text" name="email" id="email" style="width: 120px;" maxlength="10" class="cajaTextoMayuscula"
                                                                            onkeypress="javascript:ValidaCaracteres();" />*@
                                                                        @Html.TextBoxFor(model => model.vPriNombre, new { @class = "cajaTextoMayuscula", @onkeypress = "return ValidaCaracteres();" })
                                                                    </td>
                                                                    <td>
                                                                        Segundo Nombre
                                                                    </td>
                                                                    <td style="width: 2px;">
                                                                        :
                                                                    </td>
                                                                    <td>
                                                                        @Html.TextBoxFor(model => model.vSegNombre, new { @class = "cajaTextoMayuscula", @onkeypress = "return ValidaCaracteres();" })
                                                                    </td>
                                                                    <td rowspan="2" valign="top">
                                                                        <table border="0" cellpadding="1" cellspacing="0" width="100%">
                                                                            <tr align="center">
                                                                                <td>
                                                                                    Pa&iacute;s Documento
                                                                                </td>
                                                                                <td>
                                                                                    Tipo Documento
                                                                                </td>
                                                                                <td>
                                                                                    N&uacute;mero Docum.&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr align="center">
                                                                                <td>
                                                                                @Html.DropDownListFor(model => model.nIdeCodPaisDoc, (IEnumerable<SelectListItem>)ViewBag.Pais)
                                                                                    @*<select name="tipoPersona" id="tipoPersona" class="select8_MIDIS">
                                                                                        <option value="">ELIJA</option>
                                                                                        <option value="1">Peru</option>
                                                                                        <option value="2">Ecuador</option>
                                                                                    </select>*@
                                                                                </td>
                                                                                <td>
                                                                                @Html.DropDownListFor(model => model.nIdeTipoDocum, (IEnumerable<SelectListItem>)ViewBag.Documento)
                                                                                    @*<select name="tipoPersona" id="tipoPersona" class="select8_MIDIS">
                                                                                        <option value="">ELIJA</option>
                                                                                        <option value="1">DNI</option>
                                                                                        <option value="2">OTRO</option>
                                                                                    </select>*@
                                                                                </td>
                                                                                <td>
                                                                                    @Html.TextBoxFor(model => model.vNumDocum, new { @class = "cajaTextoMayuscula", @style = "width:90px", @onkeypress = "return ValidaCaracteres();" })
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                                <tr align="left">
                                                                    <td>
                                                                        Apellido Paterno
                                                                    </td>
                                                                    <td style="width: 2px;">
                                                                        :
                                                                    </td>
                                                                    <td>
                                                                        @Html.TextBoxFor(model => model.vPriApellido, new { @class = "cajaTextoMayuscula", @style = "width:120px", @onkeypress = "return ValidaCaracteres();" })
                                                                    </td>
                                                                    <td>
                                                                        Apellido Materno
                                                                    </td>
                                                                    <td style="width: 2px;">
                                                                        :
                                                                    </td>
                                                                    <td>
                                                                        @Html.TextBoxFor(model => model.vSegApellido, new { @class = "cajaTextoMayuscula", @style = "width:120px", @onkeypress = "return ValidaCaracteres();" })
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td colspan="7">
                                                                        <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                                                            <tr align="center">
                                                                                <td>
                                                                                    Tipo Persona
                                                                                </td>
                                                                                <td>
                                                                                    G&eacute;nero&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                </td>
                                                                                <td>
                                                                                    Fecha Nacimiento.&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                </td>
                                                                                <td>
                                                                                    Tel&eacute;fono&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                </td>
                                                                                <td>
                                                                                    Tel&eacute;fono2&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                </td>
                                                                                <td>
                                                                                    E-mail&nbsp;<span class="letraAsterisco_MIDIS">(*)</span>
                                                                                </td>
                                                                            </tr>
                                                                            <tr align="center">
                                                                                <td>
                                                                                @Html.DropDownListFor(model => model.nIdeTipoPer, (IEnumerable<SelectListItem>)ViewBag.TipoPersona)
                                                                                    <@*select name="tipoPersona" id="tipoPersona" class="select8_MIDIS">
                                                                                        <option value="">ELIJA</option>
                                                                                        <option value="1">Interna</option>
                                                                                        <option value="2">Externa</option>
                                                                                    </select>*@
                                                                                </td>
                                                                                <td>
                                                                                @Html.DropDownListFor(model=>model.nIdeTipoGenero,(IEnumerable<SelectListItem>)ViewBag.Genero)
                                                                                    @*<select name="tipoPersona" id="tipoPersona" class="select8_MIDIS">
                                                                                        <option value="">ELIJA</option>
                                                                                        <option value="1">MASCULINO</option>
                                                                                        <option value="2">FEMENINO</option>
                                                                                    </select>*@
                                                                                </td>
                                                                                <td>
                                                                                    <table border="0" cellpadding="0" cellspacing="0">
                                                                                        <tr>
                                                                                            <td>
                                                                                                <input type="text" name="fechaSolicitud" id="fechaSolicitud" style="width: 60px;"
                                                                                                    maxlength="10" class="cajaTextoMayuscula" onkeyup="javascript:MiFechaNew(this);"
                                                                                                    value="01/01/2013" onkeypress="javascript:ValidaCaracteres();" ondblclick="javascript:limpiaCaja(this);" />
                                                                                            </td>
                                                                                            <td>
                                                                                                <img src="../../images/Fecha.jpg" alt="MOSTRAR EL ALMANAQUE" class="lupita1_MIDIS" onclick="javascript:show_calendar(this);" />
                                                                                            </td>
                                                                                        </tr>
                                                                                    </table>
                                                                                </td>
                                                                                <td>
                                                                                    @Html.TextBoxFor(model => model.vTelefono1, new { @class = "cajaTextoMayuscula", @style = "width:70px", @onkeypress = "return ValidaCaracteres();" })
                                                                                </td>
                                                                                <td>
                                                                                    @Html.TextBoxFor(model => model.vTelefono2, new { @class = "cajaTextoMayuscula", @style = "width:70px", @onkeypress = "return ValidaCaracteres();" })
                                                                                </td>
                                                                                <td>
                                                                                    @Html.TextBoxFor(model => model.vEmail, new { @class = "cajaTextoMayuscula", @style = "width:230px", @onkeypress = "return ValidaCaracteres();" })
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        Discapacidad
                                                                    </td>
                                                                    <td>
                                                                        :
                                                                    </td>
                                                                    <td colspan="5" align="left">
                                                                        <table cellpadding="0" cellspacing="0" border="0" width="90%">
                                                                            <tr>
                                                                                <td>
                                                                                    VISUAL PARCIAL O TOTAL (Problemas para ver a&uacute;n con lentes / no puede ver)
                                                                                </td>
                                                                                <td style="width: 10px;" align="center">
                                                                                    :
                                                                                </td>
                                                                                <td>
                                                                                    <input type="checkbox" id="discapacidad1" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    PARA OIR PARCIAL O TOTAL (Problemas para oir a&uacute;n con audifonos / no puede
                                                                                    oir)
                                                                                </td>
                                                                                <td style="width: 10px;" align="center">
                                                                                    :
                                                                                </td>
                                                                                <td>
                                                                                    <input type="checkbox" id="discapacidad2" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    PARA HABLAR PARCIAL O TOTAL (Dificultad para hablar / no puede hablar)
                                                                                </td>
                                                                                <td style="width: 10px;" align="center">
                                                                                    :
                                                                                </td>
                                                                                <td>
                                                                                    <input type="checkbox" id="discapacidad2" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    PARA USAR BRAZOS Y MANOS / PIERNAS Y PIES
                                                                                </td>
                                                                                <td style="width: 10px;" align="center">
                                                                                    :
                                                                                </td>
                                                                                <td>
                                                                                    <input type="checkbox" id="discapacidad2" />
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    MENTAL O INTELECTUAL (Dificultades permanentes para entender o relacionarse con
                                                                                    los dem&aacute;s)
                                                                                </td>
                                                                                <td style="width: 10px;" align="center">
                                                                                    :
                                                                                </td>
                                                                                <td>
                                                                                    <input type="checkbox" id="discapacidad2" />
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        }</td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr>
                            <td>
                                &nbsp;
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
            <tr>
                <td>
                    &nbsp;
                </td>
            </tr>
            <tr>
                <td>
                    <table class="tablaPrincipal_MIDIS" width="100%" cellpadding="3" border="0" cellspacing="0">
                        <tr>
                            <td>
                                <table cellpadding="0" cellspacing="0" border="0" width="98%">
                                    <tr>
                                        <td>
                                            <table class="tablaTitulo_MIDIS" style="width: 180PX;" cellpadding="2" cellspacing="0"
                                                border="0">
                                                <tr>
                                                    <td align="center">
                                                        <div id="divDireccion" class="divTitulo_MIDIS" style="width: 180PX;">
                                                            <span style="background-color: #b50055; color: white;">[DIRECCI&Oacute;N DE LA PERSONA]</span>
                                                        </div>
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table width="100%" class="tablaInterna_MIDIS" cellpadding="0">
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                                <tr>
                                                    <td align="center">
                                                        <table width="98%" border="1" cellpadding="5" cellspacing="0" class="tablaPrincipalSin">
                                                            <tbody class="tituloTextNormal">
                                                                <tr>
                                                                    <td>
                                                                        <table width="100%" border="0" cellpadding="3" cellspacing="0">
                                                                            <tr>
                                                                                <td>
                                                                                    Tipo V&iacute;a
                                                                                </td>
                                                                                <td>
                                                                                    Nombre de V&iacute;a
                                                                                </td>
                                                                                <td>
                                                                                    N&uacute;mero
                                                                                </td>
                                                                                <td>
                                                                                    Dept.
                                                                                </td>
                                                                                <td>
                                                                                    Interior
                                                                                </td>
                                                                                <td>
                                                                                    MZ
                                                                                </td>
                                                                                <td>
                                                                                    Lote
                                                                                </td>
                                                                                <td>
                                                                                    KM
                                                                                </td>
                                                                                <td>
                                                                                    # block
                                                                                </td>
                                                                                <td>
                                                                                    Etapa
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <select name="tipoPersona" id="tipoPersona" class="select8_MIDIS">
                                                                                        <option value="">ELIJA</option>
                                                                                        <option value="1">MASCULINO</option>
                                                                                        <option value="2">FEMENINO</option>
                                                                                    </select>
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 208px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 50px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                            <tr>
                                                                                <td>
                                                                                    Tipo Zona
                                                                                </td>
                                                                                <td>
                                                                                    Nombre de Zona
                                                                                </td>
                                                                                <td>
                                                                                    Ubigeo
                                                                                </td>
                                                                                <td>
                                                                                    Departamento
                                                                                </td>
                                                                                <td>
                                                                                    Provincia
                                                                                </td>
                                                                                <td>
                                                                                    Distrito
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <select name="tipoPersona" id="tipoPersona" class="select8_MIDIS">
                                                                                        <option value="">ELIJA</option>
                                                                                        <option value="1">MASCULINO</option>
                                                                                        <option value="2">FEMENINO</option>
                                                                                    </select>
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 200px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <select name="tipoPersona" id="tipoPersona" class="select8_MIDIS">
                                                                                        <option value="">ELIJA</option>
                                                                                        <option value="1">MASCULINO</option>
                                                                                        <option value="2">FEMENINO</option>
                                                                                    </select>
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 100px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 100px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 100px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                                <tr>
                                                                    <td>
                                                                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                                                                            <tr>
                                                                                <td>
                                                                                    Centro Poblado
                                                                                </td>
                                                                                <td>
                                                                                    &nbsp;
                                                                                </td>
                                                                                <td>
                                                                                    Referencia &nbsp;(1)
                                                                                </td>
                                                                                <td>
                                                                                    &nbsp;
                                                                                </td>
                                                                                <td>
                                                                                    Referencia &nbsp;(2)
                                                                                </td>
                                                                            </tr>
                                                                            <tr>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 150px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    &nbsp;
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 310px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                                <td>
                                                                                    &nbsp;
                                                                                </td>
                                                                                <td>
                                                                                    <input type="text" name="email" id="email" style="width: 310px;" maxlength="10" class="cajaTextoMayuscula"
                                                                                        onkeypress="javascript:ValidaCaracteres();" />
                                                                                </td>
                                                                            </tr>
                                                                        </table>
                                                                    </td>
                                                                </tr>
                                                            </tbody>
                                                        </table>
                                                </tr>
                                                <tr>
                                                    <td>
                                                        &nbsp;
                                                    </td>
                                                </tr>
                                            </table>
                                        </td>
                                    </tr>
                                    <tr>
                                        <td>
                                            <table border="0" cellpadding="5" cellspacing="0" width="80%">
                                                <tbody class="letraLink_MIDIS">
                                                    <tr align="left">
                                                        <td>
                                                            <b>campo obligatorio:</b>&nbsp;<span class="letraAsterisco">(*)</span>
                                                        </td>
                                                        <td a>
                                                            <input type="button" id="btnGuardar" class="boton" value="Guardar" />
                                                        </td>
                                                        <td a>
                                                            <input type="button" id="btnCancelar" class="boton" value="Cancelar" onclick="Cancelar();" />
                                                        </td>
                                                    </tr>
                                                </tbody>
                                            </table>
                                        </td>
                                    </tr>
                                </table>
                            </td>
                        </tr>
                    </table>
                </td>
            </tr>
        </table>
    </div>
</center>
@section HeaderContent{
    <link type="text/css" rel="stylesheet" href="@Url.Content("~/css/orienta.css")" />
    <link type="text/css" rel="stylesheet" href="@Url.Content("~/js/niftyCorners.css")" />
}
@section JavaScript{
    <script language="javascript" type="text/javascript" src="@Url.Content("~/js/dojo.js")"></script>
    <script src="@Url.Content("~/js/midis.js")"  type="text/javascript" ></script>
    <script src="@Url.Content("~/Scripts/ORI.js")"  type="text/javascript" ></script>
    <script src="@Url.Content("~/js/niftycube.js")"  type="text/javascript" ></script>
    <script src="@Url.Content("~/js/calendario.js")"  type="text/javascript" ></script>
    <script type="text/javascript">        window.onload = function () { Nifty("div#general,div#divDireccion"); }
    </script>
}

<script type="text/javascript" language="javascript">
    $().ready(function () {
        
        $('#btnGuardar').bind("click", function (e) {

            GuardarInformacionProceso();

            e.preventDefault();
        });
    });
    function GuardarInformacionProceso() {

        //if ($("#frmMantenedor").validate().form()) {

           

            $.post($("#frmMantenedor").attr("action"), $("#frmMantenedor").serialize(), function (response) {

                if (response.Success) {
                    ORI.Regresar('tabla', 'listadoPersonas', 'informacionPersona');
                    $("#divNotificacion").hide();
                } else {
                    $("#spanMensaje").html(response.Message);
                    $("#divNotificacion").show();
                }

                
            });

//        } else {

//            $("#spanMensaje").html("Revisar los valores ingresados en el formulario.");
//            $("#divNotificacion").show();
//        }
    }
    
    
</script>
